import Vue from 'vue'
import Router from 'vue-router'
const home = () => import('../components/home.vue')
const info = () => import('../components/info.vue')
const index = () => import('../page/index.vue')
const add = () => import('../components/add.vue')
const edit = () => import('../components/edit.vue')
const amend = () => import('../components/amend.vue')
const not404 = () => import('../components/not404.vue')
const mp3 = () => import('../components/mp3.vue')
const test = () => import('../components/test.vue')

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: '/bdvoicepage/',
  routes: [
    {
      path: '*',
      name: 'not404',
      component: not404
    }, {
      path: '/test',
      name: 'test',
      component: test
    }, {
      path: '/',
      name: 'mp3',
      component: mp3
    }, {
      path: '/home',
      name: 'home',
      component: home
    }, {
      path: '/index',
      name: 'index',
      component: index,
      children: [{
        path: '/info',
        component: info,
        meta: {
          navigation: []
        }
      }, {
        path: '/add',
        component: add,
        meta: {
          navigation: ['添加数据', '添加问答']
        }
      }, {
        path: '/add/:pid',
        component: add,
        meta: {
          navigation: ['添加数据', '添加子问题']
        }
      }, {
        path: '/edit',
        component: edit,
        meta: {
          keepAlive: true,
          navigation: ['编辑', '数据管理']
        }
      }, {
        path: '/amend/:id',
        component: amend,
        meta: {
          navigation: ['编辑', '应答编辑']
        }
      }
      ]
    }
  ]
})
